package com.cos.lession52.aop;

import org.springframework.aop.MethodBeforeAdvice;

import java.lang.reflect.Method;
import java.util.Arrays;

/**
 * @author: COS
 * @time: 2022/3/7 9:13
 * @description:
 * 前置增强
 */
public class MyBeforeAdvice implements MethodBeforeAdvice {
    @Override
    public void before(Method method, Object[] args, Object target) throws Throwable {
        System.out.println("这个是前置增强");
        System.out.println("开启事务");
        System.out.println("被增强方法的名称"+method.getName());
        System.out.println("被增强方法的参数列表"+ Arrays.toString(args));
    }
}
